package puzzle.projecteuler.p200;

public class Problem190C {

	/**
	 * Pm = x1 * x2^2 * ... * xm^m
	 *    = x1 * [(x2/2) * (x2/2)] * ... * [(xm/m) * ... * (xm/m)] * C (C = 1^1*2^2*...*m^m
	 *   <= (2/(m+1))^(m(m+1)/2) * C
	 *    = (2/(m+1))^1*(4/(m+1))^2*...*(2m/(m+1))^m
	 * @param args
	 */
	public static void main(String[] args) {
		int sum = 0;
		for (int m = 2; m <= 15; m ++) {
			sum += Math.floor(p(m));
		}
		System.out.println(sum);
	}
	
	public static double p(int m) {
		
		double r = 1.0;
		for (int i = 1; i <= m; i ++) {
			r *= Math.pow(2.0*i/(m+1), i);
		}
		return r;
	}
}
